package work.parabola.keyboardswitch.pojo.query.storeswitch;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import work.parabola.keyboardswitch.common.ServerResponse;

@Data
@ToString
@EqualsAndHashCode
public class AutoProduceTesterQuery {
    private Integer row;

    private Integer col;

    private String searchWord;

    private Integer switchType;

    private String orderByAmount;

    private String orderByPrice;

    public ServerResponse validate(){
        if(this.row == null || this.row.compareTo(0) <= 0){
            return ServerResponse.createByErrorMessage("试轴器行数设置错误");
        }
        if(this.col == null || this.col.compareTo(0) <= 0){
            return ServerResponse.createByErrorMessage("试轴器列数设置错误");
        }
        return ServerResponse.createBySuccess();
    }

}
